package com.study.designmodes.service.liabilityChain.v4;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 5、构建卡槽链：是用于串起所有的责任对象的
 * 步骤：
 * 1、洗脸
 * 2、洗头
 * 3、吃早饭
 * 去上学
 *
 * @author yangyanbin
 * @since 20230323
 **/
@Component("buildWashFaceSlotChainBuilder")
public class BuildWashFaceSlotChainBuilder implements SlotChainBuilder<ProcessorSlotChain> {

    @Resource
    private WashFaceSlot washFaceSlot;

    @Resource
    private WashHairSlot washHairSlot;

    @Resource
    private HaveBreakfastSlot haveBreakfastSlot;

    /**
     * 构建方法卡槽链
     *
     * @return {@link }
     */
    @Override
    public ProcessorSlotChain build() {
        ProcessorSlotChain processorSlotChain = new ProcessorSlotChain();
        processorSlotChain.addNextSlot(washFaceSlot);
        processorSlotChain.addNextSlot(washHairSlot);
        processorSlotChain.addNextSlot(haveBreakfastSlot);

        return processorSlotChain;
    }
}
